<?php
// 本类由系统自动生成，仅供测试用途
class LoginAction extends Action {
    public function index(){
	$this->display();
    }
	public function dologin(){
	 C('','BY_USER_SET_CONFIG');
	$user=M('users');
	$where['username']=$_POST['username'];
	$where['password']=md5($_POST['password']);
	//$condition['_logic'] = 'OR';
	if ($user->where($where)->find()){
	    session('user',$where['username']);
		$this->redirect('Index/index');
	}else
	{
	 $this->error('用户名或密码错误');
	};}
		public function doLogout(){
			$_SESSION=array();
				if(isset($_COOKIE[session_name()])){
					setcookie(session_name(),'',time()-1,'/');
				}
			session_destroy();
			$this->redirect('Login/index');
		}
    
}
?>